-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add group_fisher pruning algorithm to prune a detection model #410
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wilxy @LKJacky During the development of GroupFisher, some MMRazor's problems were exposed.
Problems
L1MutableChannelUnit
inherits fromSequentialMutableChannelUnit
, butL1MutableChannelUnit
is not sequential.- Are
Mutator
andChannelUnit
necessary ? I can doGroupFisher
just withGroupFisherAlgorithm
andL1MutableChannelUnit
. https://github.com/pppppM/mmrazor/tree/group_fisher - For pruning algorithms, the boundaries between the
Algorithm
,ChannelMutator
, andChannelUnit
are not clear enough. Even though I am the developer of MMRazor, I can't find a reasonable way to divideGroupFisher
intoAlgorithm
,ChannelMutator
, andChannelUnit
Suggestions
I think the above problems are difficult to solve completely without refactoring, especially 2 and 3. There are some suggestions about refactoring.
- For the boundaries between
Mutator
andChannelUnit
, I suggest that we can refer to NNI and concentrate the logic of pruning inMutator
instead ofMutator
&ChannelUnit
.ChannelUnit
only serves as the most basic data structure.
In this way, when developers develop new pruning algorithms, they will know more clearly that they need to develop a newXXChannelMutator
based onChannelUnit
. - For the boundaries between
Mutator
andAlgorithm
,Mutator
should contain all the basic APIs of a pruning algorithm, andAlgorithm
can implement the complete pruning algorithm through these APIs.
The logic of the algorithm should be implemented inMutator
as much as possible, andAlgorithm
is just some logic for adapting to OpenMMLab so that MMRazor can be quickly used in other codebases.
Temporary Solution
Considering the reality, MMRazor needs to have some robust pruning algorithms as soon as possible, and the above suggestions cannot be realized in the short term. I suggest that the GroupFisher
can be released in the form of a project(https://github.com/open-mmlab/mmocr/tree/1.x/projects). After the above problems are completely solved, it will be merged into MMRazor
@pppppM I provide three answers for the proposed problems above.
Now, we refactor group fisher by dividing it to four parts in the folder.
|
Motivation
Add the pruning algorithm Group Fisher Pruning for Practical Network Compression as a demo to prune the detection model (like RetinaNet in this PR).
Modification